'''
	逻辑运算符
	1. 逻辑与
	2. 逻辑或
	3. 逻辑非
'''


# 1. 逻辑与
# ----------------------------------------
# 	格式:  x and y
# 	规则: 
# 		若x 为真, 那么结果就是y
# 		若x 为假, 那么结果就是x

x = 5
y = 10
print( x and y )

x = 0
y = 10
print( x and y )
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')


# 2. 逻辑或
# ----------------------------------------
# 	格式: x or y
# 	规则: 
# 		若x 为真, 那么结果就是x
# 		若x 为假, 那么结果就是y 

x = 5
y = 10
print( x or y )

x = 0
y = 10
print( x or y )
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')


# 3. 逻辑非
# ----------------------------------------
# 	格式: not x
# 	规则: 
# 		若x 为真, 那么结果就是 False
# 		若x 为假, 那么结果就是 True
# 	
# 		真即是假, 假即是真

x = 5
x = 0
print( not x )



# 练习:
a = 5
b = 0
print( a and b or b ) 	# 0
print( b and b or a ) 	# 5
print( b or b and a )   # 0


